home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
pxewin.zip
/
PXTBL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-06
|
3KB
|
112 lines
// PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
// PXTBL.HPP //
// Contents ----------------------------------------------------------------
//
// PXTbl. Class for handling PX table operations.
//
// End ---------------------------------------------------------------------
// External Reference Name for this Header ---------------------------------
#ifndef PXTBL_HPP
#define PXTBL_HPP
// End ---------------------------------------------------------------------
// Interface Dependencies --------------------------------------------------
#ifndef PXEOBJ_CPP
#include "pxeobj.cpp"
#endif // PXEOBJ_CPP //
// End ---------------------------------------------------------------------
// class PXTbl //
#define MAXSIZE 50 /* Maximum size of database
name */
_CLASSDEF(PXTbl)
class PXTbl:public PXEngObject
{
private:
/* Object name for stream
manager */
virtual const Pchar streamableName() const
{
return "PXTbl";
}
protected:
int inx; /* Current index */
int md; /* Table Mode */
int operation; /* Table operation */
int exist; /* True if table exists */
/* Empty a table. The main
reason for the isolation
is to keep access to this
member restricted to the
constructor for the table
class since you must have
a closed table before you
can empty it. */
int Empty(Pchar name);
int Exists(void);
virtual Pvoid read(Ripstream); /* Read persistant object */
virtual void write(Ropstream); /* Write persistant object */
PXTbl(StreamableInit): /* Persistant object
constructor */
PXEngObject(streamableInit)
{
}
public:
/* Constructor copies the
parent object pointer */
PXTbl(PPXEngObject my_object);
static PTStreamable build(); /* Build persistant object */
/* Open table in with correct
mode and operation */
int Open(int index,int mode,int op);
/* Use this constructor when
you wish to create a new
table */
int Open(int nfields,PPchar fields,
PPchar types,int index,
int mode);
virtual ~PXTbl(); /* Closes table */
int NumRecs(); /* Get the number of records
in the table */
int NumFlds(); /* Number of fields in tbl */
RECORDNUMBER RetNumRecs() /* Returns number of records
in database. */
{
return EngDataPtr->num_recs;
}
virtual void PXError(int org); /* Table error handler */
};
// Description -------------------------------------------------------------
//
// This class contains the constructors, destructors and members for
// interfacing with a Paradox table. It uses PXENGINE function calls.
//
// End ---------------------------------------------------------------------
// Define inserters and extractors for persistant objects:
inline Ripstream operator >> (Ripstream is,RPXTbl cl)
{return is >> (RTStreamable)cl;}
inline Ripstream operator >> (Ripstream is,RPPXTbl cl)
{return is >> (RPvoid)cl;}
inline Ropstream operator << (Ropstream os,RPXTbl cl)
{return os << (RTStreamable)cl;}
inline Ropstream operator << (Ropstream os,PPXTbl cl)
{return os << (PTStreamable)cl;}
#endif // PXTBL_HPP //